﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class Demo01
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请根据数字选择");
            Console.WriteLine("1.圆面积 2.四位数 3最大值");
            int key = int.Parse(Console.ReadLine());
            switch (key)
            {
                case 1:
                    Demo01.Text1();
                    break;
                case 2:
                    Demo01.Text2();
                    break;
                case 3:
                    Demo01.Text3();
                    break;
                default:
                    break;
            }
        }
        public static void Text1()
        {
            const double p = 3.14;
            Console.WriteLine("请输入圆的半径");
            double r = double.Parse(Console.ReadLine());
            double m = p * r * r;
            Console.WriteLine("圆的面积"+m);
            Console.ReadLine();
        }
        public static void Text2()
        {
            Console.WriteLine("请输入一个四位数");
            int i = int.Parse(Console.ReadLine());
            int q = i / 1000;
            int b = (i - q * 1000) / 100;
            int s = (i - q * 1000 - b * 100) / 10;
            int g = (i - q * 1000 - b * 100 - s * 10);
            Console.WriteLine("用户输入的千位为" + q+ "，百位为" + b+ "，十位为" + s+ "，个位为" + g);
            Console.ReadLine();
        }
        public static void Text3()
        {
            Console.WriteLine("请输入第1个数");
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入第2个数");
            int b = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入第3个数");
            int c = int.Parse(Console.ReadLine());

            if (a < b)
            {
                a = b;
            }
            if (a < c)
            {
                a = c;
            }
            Console.WriteLine("最大的数是："+a);
            Console.ReadLine();
        }
    }
}
